<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue'
import { queryFunds } from "../../../../api/index.js";
export default {
  data() {
    return {
      cdata: {
        month: [],
        inputSum: [],
        outputSum: [],
      }
    }
  },
  components: {
    Chart,
  },
  mounted() {
    this.getData();
  },
  methods: {
    getData() {
      let that = this;
      queryFunds().then(res => {
        that.cdata.month = []
        that.cdata.inputSum = []
        that.cdata.outputSum = []
        res.data.forEach(index => {
          let inputSum = index.inputSum / 10000000
          let outputSum = index.outputSum / 10000000
          that.cdata.month.push(index.month);
          that.cdata.inputSum.push(inputSum.toFixed(2));
          that.cdata.outputSum.push(outputSum.toFixed(2));
        });
      })
    }
  }
};
</script>

<style lang="scss" scoped>
</style>